/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.projeto.web;

import java.io.IOException;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;

/**
 *
 * @author fneves
 */
@ManagedBean
@SessionScoped
public class GenericBackBean implements Serializable{

    public void logout() throws IOException {
        final HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false);
        if (session != null)
        {
            session.invalidate();
        }
        FacesContext.getCurrentInstance().getExternalContext().redirect("http://localhost:8080/trade");  
    }
}
